<?php

class Recursos_Form_Recursos extends Zend_Form
{
protected $_elementos = array();
    
	public function init()
    {
        /* Form Elements & Other Definitions Here ... */
    	$this->setName("recusros");
    	$this->setMethod('post');
    	 
    	 
    	$recurso = new Zend_Form_Element_Text('recurso');
    	$recurso->setLabel(_('Caminho Ex. "Modulo/Controle/Ação" '))
    	->setRequired(TRUE)
    	->setFilters(array("StripTags", "StringTrim"))
    	->setValidators(array("NotEmpty"))
    	;
    	
    	
    	$this->_elementos[] = $recurso;
    	 
    	$enviar = new Zend_Form_Element_Submit("submit");
    	$enviar->setIgnore(true)
    	->setLabel("Enviar")
    	->removeDecorator('HtmlTag');
    	$this->_elementos[] = $enviar;
    	
    	$token = new Zend_Form_Element_Hash('token');
    	$token->setSalt('s4a1t-53gur0')
    	->setTimeout(300)
    	->setIgnore(true)
    	->removeDecorator('HtmlTag')
    	->removeDecorator('Label')
    	->addErrorMessage(_('Token provided did not match, session expired. Please reload the form.'));
    	;
    	$this->_elementos[] = $token;
    	$this->addElements($this->_elementos);
    }
	
    public function multi_check($nome, $arr = array()){
    	$multi = new Zend_Form_Element_MultiCheckbox($nome);
    	$multi->removeDecorator('HtmlTag')
    		->removeDecorator('Label')
    		->setRequired(false)
    		->setMultiOptions($arr)
    		;
    	$this->addElements($multi);
    }

}

